//
//  DecoratorPatternTests.m
//  DecoratorPatternTests
//
//  Created by 颖 on 2016/12/20.
//  Copyright © 2016年 ying. All rights reserved.
//

#import <XCTest/XCTest.h>
#import "WYXBeverage.h"
#import "WYXEspresso.h"
#import "WYXMilk.h"
#import "WYXHouseBlend.h"
#import "WYXSoy.h"
#import "WYXWhip.h"

@interface DecoratorPatternTests : XCTestCase

@end

@implementation DecoratorPatternTests

- (void)setUp {
    [super setUp];
    // Put setup code here. This method is called before the invocation of each test method in the class.
}

- (void)tearDown {
    // Put teardown code here. This method is called after the invocation of each test method in the class.
    [super tearDown];
}

- (void)testExample {
    // This is an example of a functional test case.
    // Use XCTAssert and related functions to verify your tests produce the correct results.
}

- (void)testEspresso{
    // 一杯浓缩咖啡
    WYXBeverage *espresso = [[WYXEspresso alloc] init];
    // 加奶
    espresso = [[WYXMilk alloc] initWithBeverage:espresso];
    NSLog(@"%@",espresso.descriptionBeverage);
    NSLog(@"%f",espresso.cost);
    
}

- (void)testHouseblend{
    // 一杯混合咖啡
    WYXBeverage *houseblend = [[WYXHouseBlend alloc] init];
    // 加奶
    houseblend = [[WYXMilk alloc] initWithBeverage:houseblend];
    // 加豆浆
    houseblend = [[WYXSoy alloc] initWithBeverage:houseblend];
    // 加奶泡
    houseblend = [[WYXWhip alloc] initWithBeverage:houseblend];
    NSLog(@"%@",houseblend.descriptionBeverage);
    NSLog(@"%f",houseblend.cost);
}

- (void)testPerformanceExample {
    // This is an example of a performance test case.
    [self measureBlock:^{
        // Put the code you want to measure the time of here.
    }];
}

@end
